<?php
namespace app\admin\controller;
use think\Controller;
class Base extends Controller
{ 
    public function _initialize()
    {
        $this->auth();
    }

    public function auth()
    {
        $module = request()->module();
        $controller = request()->controller();
        $action = request()->action();
        $auth = new \app\admin\controller\Auth();
        if(!$auth->check($module .'/'.$controller . '/' . $action, session('uid'))){
            $this->error('你没有权限访问',"/");
        }
    }
}